package orgs

import (
	"github.com/gin-gonic/gin"
	"gogs.xiaoyuanjijiehao.com/antlinker/antcms/app/ginsrv/oplog"
	"gogs.xiaoyuanjijiehao.com/antlinker/antcms/core"
)

// Init 初始化
func Init(route *gin.RouterGroup, d core.CmsDomain) {
	org := createCtrl(d)
	route.GET(":orgid", oplog.OplogRoute("cms/orgs/getone", "获取指定组织信息", org.getOrg))
	route.POST(":orgid", oplog.OplogRoute("cms/orgs/add", "新增组织", org.add))
	route.DELETE(":orgid", oplog.OplogRoute("cms/orgs/delete", "删除组织", org.delete))
	route.DELETE(":orgid/destroy", oplog.OplogRoute("cms/orgs/destroy", "彻底删除组织", org.destroy))
	route.PUT(":orgid/icon", oplog.OplogRoute("cms/orgs/update/icon", "恢复删除组织", org.updateIcon))
	route.PUT(":orgid/columns", oplog.OplogRoute("cms/orgs/update/columns", "恢复删除组织", org.updateColumn))
	route.PUT(":orgid/desc", oplog.OplogRoute("cms/orgs/update/desc", "修改组织描述", org.updateDesc))
	route.PUT(":orgid/publish", oplog.OplogRoute("cms/orgs/publish", "发布组织展板", org.publish))
	route.PUT(":orgid/nopublish", oplog.OplogRoute("cms/orgs/nopublish", "取消发布组织展板", org.nopublish))
}
